﻿using Dapper;
using System;
using BCEntity.Sim.Admin.AdminAuth;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;
using BCCommon.Enums;

namespace BCData.Sim.Admin.AdminAuth
{
    /// <summary>
    /// 员工授权信息
    /// </summary>
    public interface IAdminAuthData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="adminAuthId">员工授权信息Id</param>
        Task<bool> Exists(long adminAuthId);
        // <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="authType">授权类型</param>
        /// <param name="unionId">授权唯一标识</param>
        Task<bool> Exists(AuthType authType, string unionId);
        /// <summary>
        /// 增加员工授权信息
        /// </summary>
        /// <param name="entity">员工授权信息信息</param>
        Task<AdminAuthEntity> Add(AdminAuthEntity entity);
        /// <summary>
        /// 更新员工授权信息
        /// </summary>
        /// <param name="entity">员工授权信息信息</param>
        Task<AdminAuthEntity> Update(AdminAuthEntity entity);
        /// <summary>
        /// 删除员工授权信息
        /// </summary>
        /// <param name="adminAuthId">员工授权信息Id</param>
        Task<bool> Delete(long adminAuthId);
        /// <summary>
        /// 获取员工授权信息
        /// </summary>
        /// <param name="adminAuthId">员工授权信息Id</param>
        Task<AdminAuthEntity> GetEntity(long adminAuthId);
        /// <summary>
        /// 获取员工授权信息
        /// </summary>
        /// <param name="authType">授权类型</param>
        /// <param name="unionId">授权唯一标识</param>
        Task<AdminAuthEntity> GetEntity(AuthType authType, string unionId);
        /// <summary>
        /// 获取员工授权信息列表
        /// </summary>
        /// <param name="adminId">员工Id</param>
        Task<IEnumerable<AdminAuthEntity>> GetList(long adminId);
        /// <summary>
        /// 获取员工授权信息分页列表
        /// </summary>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<AdminAuthEntity>, int)> Query(DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}